<?
$params[sid] = $sid;
$params[action] = "editW9Form";
	
// if($errorMsg) echo "<br><div class=errormsg>$errorMsg</div><br>";
        $url = "$baseURL/$webDIR/?".encode_params($params);

?>
<SCRIPT language=JavaScript>
<!--

function checkFields(form) {
    if (isBlank(form.name.value)) {
        alert('<?=translate('enter_name');?>.')
        form.name.focus();
        return false;
        form.percentageType(1).checked
    } else if ((!form.entityType(0).checked) &&
        (!form.entityType(1).checked) &&
        (!form.entityType(2).checked) &&
        (!form.entityType(3).checked)) {
        alert('<?=translate('check_business');?>.')
        return false;
    } else if (isBlank(form.address.value)) {
        alert('<?=translate('enter_addr');?>.')
        form.address.focus();
        return false;
    } else if (isBlank(form.city.value)) {
        alert('<?=translate('enter_city');?>.')
        form.city.focus();
        return false;
    } else if (isBlank(form.stateProvince.options[form.stateProvince.selectedIndex].value)) {
        alert('<?=translate('enter_state');?>.')
        form.stateProvince.focus();
        return false;
    } else if (isBlank(form.postalCode.value)) {
        alert('<?=translate('enter_zip');?>.')
        form.city.focus();
        return false;
    } else if (isBlank(form.tinNumber.value)) {
        alert('<?=translate('enter_payer');?>.')
        form.tinNumber.focus();
        return false;
    } else if (!isNumeric(form.tinNumber.value)) {
        alert('<?=translate('only_nums_payer');?>.')
        form.tinNumber.focus();
        return false;
    } else if (form.tinNumber.value <= 0) {
        alert('<?=translate('enter_valid_number');?>.')
        form.tinNumber.focus();
        return false;
    } else if (isBlank(form.username.value)) {
        alert('<?=translate('enter_user');?>.')
        form.username.focus();
        return false;
    } else if ((!form.tinType(0).checked) &&
        (!form.tinType(1).checked)) {
        alert('<?=translate('check_id_type');?>.')
        return false;
    } else {
        return true;
    }


}

//-------------------------------------------------------------------
// trimSpaces(infield)
//-------------------------------------------------------------------
function trimSpaces(infield) {
	var temp = "";
	infield = '' + infield;
	splitfield = infield.split(" ");
	for(i = 0; i < splitfield.length; i++)
		temp += splitfield[i];
	return temp;
}

//-------------------------------------------------------------------
// isInteger(val)
//   Returns true if value contains all digits
//-------------------------------------------------------------------
function isInteger(val){
	for(var i=0;i<val.length;i++){
		if(!isDigit(val.charAt(i))){return false;}
		}
	return true;
	}


//-------------------------------------------------------------------
// isBlank(value)
//   Returns true if value only contains spaces
//-------------------------------------------------------------------
function isBlank(val){
	if(val==null){
        return true;
    }
	for(var i=0;i<val.length;i++) {
		if ((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r")){
            return false;
        }
	}
	return true;
}

//-------------------------------------------------------------------
// isDigit(num)
//   Returns true if value is a 1-character digit
//-------------------------------------------------------------------
function isDigit(num) {
	if (num.length>1){return false;}
	var string="1234567890";
	if (string.indexOf(num)!=-1){return true;}
	return false;
	}


//-------------------------------------------------------------------
// isNumeric(value)
//   Returns true if value contains a positive float value
//-------------------------------------------------------------------
function isNumeric(val){return(parseFloat(val,10)==(val*1));}

//-->
</SCRIPT>

<STYLE>BODY {
	FONT-SIZE: 11px; BACKGROUND: #ffffff; FONT-FAMILY: arial, helvetica, sans-serif
}
TD {
	FONT-SIZE: 11px; FONT-FAMILY: arial, helvetica, sans-serif
}
INPUT {
	FONT-SIZE: 11px; FONT-FAMILY: arial, helvetica, sans-serif
}
.blackSpace {
	BACKGROUND: #000000; WIDTH: 100%; HEIGHT: 2px
}
.partSection {
	BACKGROUND: #cccccc; WIDTH: 100%; HEIGHT: 20px
}
.title {
	FONT-WEIGHT: bold; FONT-SIZE: 13px
}
</STYLE>

<META content="MSHTML 6.00.2734.1600" name=GENERATOR></HEAD>
<BODY>
<?
//include("/www/resellers_advanced/admin/functions.php");
include($baseDIR . '/admin/functions.php');

$count=w9_get_count($id);
if($count > 0){
	echo "	<br>
		<b>" . translate('submit_forms', array('count' => $count)) . "
		</b>
		<br><br>";
}
?>
<SPAN class=title><?=translate('w9_request');?></SPAN>
<?
	if ($errorMsg) {
	include_once('errorMsg.html');
	}
	if ($okMsg) {
	include_once('okMsg.html');
	}
	else{
	}
?> 
<FORM name=w9form onsubmit="return checkFields(this)" action='<?=$url?>' method=post 
encType=x-www-form-urlencoded>
<INPUT type=hidden value=true name=submit> <INPUT 
type=hidden value=W9 name=formID> <INPUT type=hidden value=80042 name=payeeID> 

<INPUT type=hidden value=false name=isUpdate> 
<TABLE cellSpacing=0 cellPadding=1 width=599 border=0>
  <TBODY>
  <TR>
    <TD><B><?=translate('name');?></B><BR><INPUT size=30 name=name> </TD></TR>
  <TR>
    <TD><IMG class=blackSpace alt="" src="" border=0></TD></TR>
  <TR>
    <TD><B><?=translate('business_name_different');?></B><BR><INPUT size=30 
      name=company> </TD></TR>

  <TR>
    <TD><IMG class=blackSpace alt="" src="" border=0></TD></TR>
  <TR>
    <TD><B><?=translate('check_appropriate');?>:</B><BR><IMG height=3 alt="" src="" width=1 
      border=0><BR>
      <TABLE cellSpacing=0 cellPadding=1 width="100%" border=0>
        <TBODY>
        <TR>
          <TD vAlign=bottom width=5><INPUT type=radio value=I 
          name=entityType></TD>

          <TD vAlign=bottom width=75><?=translate('individual');?></TD>
          <TD vAlign=bottom width=5><INPUT type=radio value=C 
          name=entityType></TD>
          <TD vAlign=bottom width=25><?=translate('corp');?></TD>
          <TD vAlign=bottom width=5><INPUT type=radio value=P 
          name=entityType></TD>
          <TD vAlign=bottom width=25><?=translate('partner');?></TD>
          <TD vAlign=bottom width=5><INPUT type=radio value=O 
          name=entityType></TD>
          <TD vAlign=bottom width=200><?=translate('other');?> <INPUT name=entityTypeDescription> 
          </TD></TR></TBODY></TABLE></TD></TR>

  <TR>
    <TD><IMG class=blackSpace alt="" src="" border=0></TD></TR>
  <TR>
    <TD><INPUT type=checkbox value=true name=backupWithHoldingExempt><?=translate('exempt_backup');?> </TD></TR>
  <TR>
    <TD><IMG class=blackSpace alt="" src="" border=0></TD></TR>
  <TR>
    <TD><B><?=translate('address');?></B><BR><INPUT 
      size=30 name=address> </TD></TR>

  <TR>
    <TD><IMG class=blackSpace alt="" src="" border=0></TD></TR>
  <TR>
    <TD><B><?=translate('city');?></B><BR><INPUT size=30 name=city> </TD></TR>
  <TR>
    <TD><IMG class=blackSpace alt="" src="" border=0></TD></TR>
  <TR>
    <TD><B><?=translate('state');?></B><BR><SELECT name=stateProvince> <OPTION value="  " 
        selected><?=translate('select_state');?><OPTION value=AL>Alabama<OPTION 
        value=AK>Alaska<OPTION value=AZ>Arizona<OPTION value=AR>Arkansas<OPTION 
        value=CA>California<OPTION value=CO>Colorado<OPTION 
        value=CT>Connecticut<OPTION value=DE>Delaware<OPTION value=DC>District 
        of Columbia<OPTION value=FL>Florida<OPTION value=GA>Georgia<OPTION 
        value=HI>Hawaii<OPTION value=ID>Idaho<OPTION value=IL>Illinois<OPTION 
        value=IN>Indiana<OPTION value=IA>Iowa<OPTION value=KS>Kansas<OPTION 
        value=KY>Kentucky<OPTION value=LA>Louisiana<OPTION value=ME>Maine<OPTION 
        value=MD>Maryland<OPTION value=MA>Massachusetts<OPTION 
        value=MI>Michigan<OPTION value=MN>Minnesota<OPTION 
        value=MS>Mississippi<OPTION value=MO>Missouri<OPTION 
        value=MT>Montana<OPTION value=NE>Nebraska<OPTION value=NV>Nevada<OPTION 
        value=NH>New Hampshire<OPTION value=NJ>New Jersey<OPTION value=NM>New 
        Mexico<OPTION value=NY>New York<OPTION value=NC>North Carolina<OPTION 
        value=ND>North Dakota<OPTION value=OH>Ohio<OPTION 
        value=OK>Oklahoma<OPTION value=OR>Oregon<OPTION 
        value=PA>Pennsylvania<OPTION value=RI>Rhode Island<OPTION value=SC>South 
        Carolina<OPTION value=SD>South Dakota<OPTION value=TN>Tennessee<OPTION 
        value=TX>Texas<OPTION value=UT>Utah<OPTION value=VT>Vermont<OPTION 
        value=VA>Virginia<OPTION value=WA>Washington<OPTION value=WV>West 
        Virginia<OPTION value=WI>Wisconsin<OPTION value=WY>Wyoming<OPTION 
        value="  "><OPTION value=AB>Alberta<OPTION value=BC>British 
        Columbia<OPTION value=MB>Manitoba<OPTION value=NB>New Brunswick<OPTION 
        value=NF>Newfoundland<OPTION value=NT>Northwest Territory<OPTION 
        value=NS>Nova Scotia<OPTION value=ON>Ontario<OPTION value=PE>Prince 
        Edward Island<OPTION value=PQ>Quebec<OPTION value=SP>St. Pierre &amp; 
        Miguelon<OPTION value=SK>Saskatchewan<OPTION value=YU>Yukon 
        Territory<OPTION value="  "><OPTION value=AC>Australian Capital<OPTION 
        value=NW>New South Wales<OPTION value=NO>Northern Territory<OPTION 
        value=QL>Queensland<OPTION value=SA>South Australia<OPTION 
        value=TS>Tasmania<OPTION value=VC>Victoria<OPTION value=WT>Western 
        Australia</OPTION></SELECT> </TD></TR>

  <TR>
    <TD><IMG class=blackSpace alt="" src="" border=0></TD></TR>
  <TR>
    <TD><B><?=translate('zip');?></B><BR><INPUT size=10 name=postalCode> </TD></TR><INPUT 
  type=hidden value=US name=country> 
  <TR>
    <TD><IMG class=blackSpace alt="" src="" border=0></TD></TR>
  <!--TR>
    <TD><B>List account number(s) here (optional)</B><BR><INPUT size=30 
      name=accountReference> </TD></TR>

  <TR>
    <TD><IMG class=blackSpace alt="" src="" border=0></TD></TR-->
  <TR>
    <TD><SPAN class=partSection><B><?=translate('part1');?></B> - <?=translate('tin');?></SPAN><BR>
      <TABLE cellSpacing=0 cellPadding=1 border=0>
        <TBODY>
        <TR>

          <TD vAlign=top>
	  <?=translate('enter_tin_desc');?>
          </TD>

          <TD vAlign=top><INPUT maxLength=9 name=tinNumber> <BR><INPUT 
            type=radio value=E name=tinType>EIN <INPUT type=radio value=S 
            name=tinType>SSN </TD></TR></TBODY></TABLE></TD></TR>
  <TR>
    <TD><IMG class=blackSpace alt="" src="" border=0></TD></TR>
  <TR>
    <TD><SPAN class=partSection><B><?=translate('part2');?></B> - <?=translate('cert_certify');?>:<BR>

      <OL>
      <?=translate('certify');?>
       </OL></TD></TR>

  <TR>
    <TD><IMG class=blackSpace alt="" src="" border=0></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=599 border=0>
  <TBODY>
  <TR>
    <TD colSpan=3><B><?=translate('us_signature');?>: </B></TD></TR>
  <TR>
    <TD width=100><B><?=translate('signature_here');?></B></TD>

    <TD vAlign=bottom><?=translate('your_name');?>: <INPUT size=30 name=username></TD>
    <TD vAlign=bottom width=150><?=translate('date');?>: <?=date('m/d/y');?></TD></TR>
  <TR>
    <TD align=middle colSpan=3>&nbsp;</TD></TR>
  <TR>
    <TD align=middle colSpan=3><INPUT type=submit value="<?=translate('submit_tax');?>" name=submitw9></TD></TR></TBODY></TABLE></FORM></BODY></HTML>

